package com.ljb.utilslibrary.ossutils.listener;

import com.alibaba.sdk.android.oss.ClientException;
import com.alibaba.sdk.android.oss.ServiceException;
import com.alibaba.sdk.android.oss.model.PutObjectRequest;
import com.alibaba.sdk.android.oss.model.PutObjectResult;

/**
 * OSS上传文件的回调接口
 * Created by lijianbin on 2016/11/22.
 */
public interface UploadCBListener {

    /**
     * 上传过程中的回调
     *
     * @param request
     * @param currentSize
     * @param totalSize
     */
    void onProgress(PutObjectRequest request, long currentSize, long totalSize);

    /**
     * 上传成功的回调
     *
     * @param request
     * @param result
     */
    void onSuccess(PutObjectRequest request, PutObjectResult result);

    /**
     * 上传失败的回调
     *
     * @param request
     * @param clientExcepion
     * @param serviceException
     */
    void onFailure(PutObjectRequest request, ClientException clientExcepion, ServiceException serviceException);
}
